<?php
namespace Admin;

use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Session ;
use Illuminate\Support\Facades\Redirect ;

class CommentController extends BaseController
{    
    //显示评论
    public function index()
    {
        $comments = \Comment::paginate(5);
        return View::make('admin.Comment.index')->with('comments', $comments);
    }

    //查看评论界面
    public function show($id)
    {
        $comment = \Comment::find($id) ;
        return View::make('admin.Comment.show')->with('comment', $comment) ;
    }
    
    //审核评论
    public function update($id)
    {
        $comment = \Comment::find($id);
        $comment->status = Input::get('status');
        $comment->save();
       
        Session::flash('message', '评论审核OK！');
        return Redirect::to('admin/comment');
    }
}